import React, { useEffect, useContext } from 'react';
import { Switch, Route, useLocation, Redirect, useHistory, useParams } from 'react-router-dom';
import _ from 'lodash';
import Page403 from '@/pages/notFound/Page403';
import NotFound from '@/pages/notFound';
import Demo from '@/pages/demo';


function RouteWithSubRoutes(route) {
  return (
    <Route
      path={route.path}
      render={(props) => (
        // pass the sub-routes down to keep nesting
        <route.component {...props} routes={route.routes} />
      )}
    />
  );
}

export default function Content() {
  const location = useLocation();
  const history = useHistory();
  useEffect(() => {
    
  }, []);

  return (
    <div className={`content `}>
      <Switch>
        <Route path='/demo' component={Demo} />
        <Route path='/' exact>
          <Redirect to={ '/demo'} />
        </Route>
        <Route path='/403' component={Page403} />
        <Route path='/404' component={NotFound} />
        <Route path='*' component={NotFound} />
      </Switch>
    </div>
  );
}
